home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / CSMP Digest / volume 2 / csmp-v2-014.txt < prev    next >
Text File  |  1995-06-30  |  42KB  |  1,140 lines

  1. C.S.M.P. Digest             Sat, 20 Feb 93       Volume 2 : Issue 14
  2.  
  3. Today's Topics:
  4.  
  5.     LDEF sample
  6.     Resource compression/decompression
  7.     Where do I get the highlight color?
  8.     List Manager help wanted
  9.     File system problem - RstLock not updating...
  10.     How to check for gray-scale screen?
  11.  
  12.  
  13.  
  14. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  15.  
  16. The digest is a collection of article threads from the usenet newsgroup
  17. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  18. regularly and want an archive of the discussions.  If you don't know what a
  19. newsgroup is, you probably don't have access to it.  Ask your systems
  20. administrator(s) for details.  If you don't have access to news, you can
  21. post articles to any newsgroup by mailing your article to
  22.     newsgroup@cs.utexas.edu
  23. So, to post an article to comp.sys.mac.programmer, mail your article to
  24.     comp-sys-mac-programmer@cs.utexas.edu
  25. Note the '-' instead of '.' in the newsgroup name.  Be sure to ask that
  26. replies be emailed to you instead of posted to the group, and give your
  27. email address.
  28.  
  29. Each issue of the digest contains one or more sets of articles (called
  30. threads), with each set corresponding to a 'discussion' of a particular
  31. subject.  The articles are not edited; all articles included in this digest
  32. are in their original posted form (as received by our news server at
  33. cs.uoregon.edu).  Article threads are not added to the digest until the last
  34. article added to the thread is at least one month old (this is to ensure that
  35. the thread is dead before adding it to the digest).  Article threads that
  36. consist of only one message are generally not included in the digest.
  37.  
  38. The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
  39. [128.223.8.8] in the directory /pub/mac/csmp-digest.  Be sure to read the
  40. file /pub/mac/csmp-digest/README before downloading any files.  The most
  41. recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
  42. directory /info-mac/digest/csmp.  If you don't have ftp capability, the sumex
  43. archive has a mail server; send a message with the text '$MACarch help' (no
  44. quotes) to LISTSERV@ricevm1.rice.edu for more information.
  45.  
  46. The digest is also available via email.  Just send a note saying that you
  47. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  48. automatically receive each new issue as it is created.  Sorry, back issues
  49. are not available through the mailing list.
  50.  
  51. Send administrative mail to mkelly@cs.uoregon.edu.
  52.  
  53.  
  54. -------------------------------------------------------
  55.  
  56. From: winer@husc10.harvard.edu (Adam Winer)
  57. Subject: LDEF sample
  58. Date: 20 Jan 93 07:57:24 GMT
  59.  
  60. Here's that LDEF I promised (my apologies for the word wrap):
  61.  
  62.  
  63. /* This code is modified from the code sicnLDEF, which is somewhere */
  64. /* in the sample code directory at ftp.apple.com */
  65.  
  66. /* It (should) behave exactly like the standard LDEF: if it doesn't, or */
  67. /* if it fails to work at all, write me at winer@husc.harvard.edu */
  68. /* NB: I _haven't_ tested this code */
  69.  
  70. /* Please note the comments in the code indicating what portions of */
  71. /* the code should be commented out in order to remove either */
  72. /* the automatic condensing or the automatic ellipsis removing */
  73.  
  74. /* A suggestion to beginning LDEF programmers: try modifying the code */
  75. /* slightly: for example, use a couple of bytes at the beginning of */
  76. /* the data you pass in to store style and font info.  This way, */
  77. /* every cell can have its own font and style! */
  78.  
  79. /* There's a lot of things you can't do with LDEF's, like have variable */
  80. /* width columns, but there are plenty of things you can do. */
  81. /* Just start from a simple LDEF, and think about what needs to be done */
  82. /* to draw a cell, and to highlight a cell */
  83.  
  84.  
  85. /* constants for spacing */
  86.  
  87. #define kLeftOffset    2
  88. #define kTopOffset    0
  89. #define TRUE        1
  90. #define FALSE        0
  91.  
  92. /* main LDEF entry point */
  93.  
  94. pascal void    main(short lMessage,Boolean lSelect,Rect *lRect,Cell lCell,
  95.                 short lDataOffset,short lDataLen,ListHandle lHandle)
  96. {
  97.     FontInfo fontInfo;                        /* font information (ascent/descent/etc) */
  98.     ListPtr listPtr;                        /* pointer to store dereferenced list */
  99.     SignedByte hStateList,hStateCells;        /* state variables for HGetState/SetState */
  100.     Ptr cellData;                            /* points to start of cell data for list */
  101.     short leftDraw,topDraw;                    /* left/top offsets from topleft of cell */
  102.     short i;
  103.     short wayleft,middle,sndLeftDraw;
  104.     short shrunk;
  105.     
  106.     /* lock and dereference list mgr handles */
  107.     
  108.     hStateList = HGetState(lHandle);
  109.     HLock(lHandle);
  110.     listPtr = *lHandle;
  111.     hStateCells = HGetState(listPtr->cells);
  112.     HLock(listPtr->cells);
  113.     cellData = *(listPtr->cells);
  114.     
  115.     switch (lMessage) {
  116.       case lInitMsg:
  117.           /* we don't need any initialization */
  118.           break;
  119.  
  120.       case lDrawMsg:
  121.         EraseRect(lRect);
  122.         
  123.           if (lDataLen > 0) {
  124.               i=lDataLen;
  125.               /* determine starting point for drawing */
  126.               
  127.               wayleft=lCell.h*listPtr->cellSize.h+(listPtr->rView.left);
  128.               leftDraw =    wayleft+listPtr->indent.h+kLeftOffset;
  129.               topDraw =    lRect->top+listPtr->indent.v+kTopOffset;
  130.  
  131.             GetFontInfo(&fontInfo);
  132.             MoveTo(leftDraw,topDraw+fontInfo.ascent);
  133.             
  134.             /* set condensed mode if necessary (if the text */
  135.             /* doesn't fit otherwise) */
  136.             
  137.             TextFace(0);
  138.             shrunk=FALSE;
  139.     /* to get rid of condensing+ellipsis comment out until */
  140.     /* before DrawText */
  141.             if (TextWidth(cellData,lDataOffset,i) > 
  142.                     (middle - leftDraw)) {
  143.     /* to get rid of condensing _only_, comment out the */
  144.     /* next line */
  145.                 TextFace(condense);
  146.     /* to get rid of ellipsis _only_, comment out the */
  147.     /* next 5 lines */
  148.                 while (TextWidth(cellData,lDataOffset,i+1) > 
  149.                     (middle - leftDraw)) {
  150.                     shrunk=TRUE;
  151.                     i--;
  152.                 }
  153.             }
  154.             if (shrunk)
  155.                 cellData[lDataOffset+i-1]='...';
  156.                     /* These three dots should be option-semicolon in */
  157.                     /* practice, but it wouldn't show up on UNIX */
  158.             DrawText(cellData,lDataOffset,i);
  159.             
  160.           }
  161.         if (!lSelect) /* if the cell is selected, then use the hiliting */
  162.                       /* procedure to do the inversion */
  163.               break;
  164.         
  165.       case lHiliteMsg:
  166.           /* do hilite color */
  167.           BitClr(&HiliteMode,pHiliteBit);
  168.           InvertRect(lRect);
  169.           break;
  170.  
  171.       case lCloseMsg:
  172.           break;
  173.     }
  174.     
  175.     HSetState(listPtr->cells,hStateCells);
  176.     HSetState(lHandle,hStateList);
  177. }
  178. - -- 
  179. Adam Winer              | The number you have reached is imaginary.
  180. WINER@HUSC.HARVARD.EDU  | Please rotate your phone 90 degrees and
  181.                         | try again.
  182.  
  183. ---------------------------
  184.  
  185. From: juggler@netcom.com (Chris Calande)
  186. Subject: Resource compression/decompression
  187. Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
  188. Date: Sat, 16 Jan 1993 03:31:50 GMT
  189.  
  190. The resource manager can now decompress resources.  Does anybody know if
  191. there is anything (code examples, application, etc.) that will let us
  192. compress our resources or is Apple the only one able to take advantage
  193. of this feature of the resource manager.?
  194.  
  195. Thanks in advance,
  196.  
  197. Scott
  198.  
  199. juggler@netcom2.netcom.com
  200.  
  201.  
  202. +++++++++++++++++++++++++++
  203.  
  204. From: wysocki@netcom.com (Chris Wysocki)
  205. Organization: Connectix Corporation, San Mateo, CA
  206. Date: Sat, 16 Jan 1993 09:03:40 GMT
  207.  
  208. In article <1993Jan16.033150.23822@netcom.com> juggler@netcom.com
  209. (Chris Calande) writes:
  210.  
  211. >The resource manager can now decompress resources.  Does anybody know if
  212. >there is anything (code examples, application, etc.) that will let us
  213. >compress our resources or is Apple the only one able to take advantage
  214. >of this feature of the resource manager.?
  215.  
  216. There is an article in the January MacTech (formerly MacTutor) about
  217. resource compression.  It describes how the Resource Manager handles
  218. compressed resources as well as how to implement your own resource
  219. compressor.  If you're looking for an off-the-shelf product to
  220. compress resources for you, check out VISE from MindVision.  I believe
  221. that some of the major compression applications can also do resource
  222. compression, but I haven't personally used any of them.
  223.  
  224. Chris.
  225.  
  226.  
  227. - -- 
  228. - ------------------------------------------------------------------------------
  229. Chris Wysocki                                     Internet: wysocki@netcom.com
  230. Software Engineer                                   America Online: AFA ChrisW
  231. Connectix Corporation                                   CompuServe: 72010,1140
  232.  
  233.  
  234. +++++++++++++++++++++++++++
  235.  
  236. From: seth@physc1.byu.edu
  237. Date: 15 Jan 93 23:57:28 -0700
  238. Organization: Brigham Young University
  239.  
  240. In article <1993Jan16.033150.23822@netcom.com>, juggler@netcom.com (Chris Calande) writes:
  241. > The resource manager can now decompress resources.  Does anybody know if
  242. > there is anything (code examples, application, etc.) that will let us
  243. > compress our resources or is Apple the only one able to take advantage
  244. > of this feature of the resource manager.?
  245. > Thanks in advance,
  246. > Scott
  247. > juggler@netcom2.netcom.com
  248.  
  249. If you look at the dialog that comes up if you hit the "Get Resource Info" menu
  250. command while looking at a particular resource, one of the options available
  251. with its check-box is compression. I haven't ever checked this box, but I know
  252. it is there.
  253.  
  254. Seth Leigh
  255. BYU Physics Dept.
  256.  
  257.  
  258. +++++++++++++++++++++++++++
  259.  
  260. Organization: Royal Institute of Technology, Stockholm, Sweden
  261. Date: Sat, 16 Jan 1993 19:50:57 GMT
  262.  
  263. In <1993Jan15.235728.343@physc1.byu.edu> seth@physc1.byu.edu writes:
  264.  
  265. >> The resource manager can now decompress resources.  Does anybody know if
  266. >> there is anything (code examples, application, etc.) that will let us
  267. >> compress our resources or is Apple the only one able to take advantage
  268.  
  269. >If you look at the dialog that comes up if you hit the "Get Resource Info" menu
  270. >command while looking at a particular resource, one of the options available
  271. >with its check-box is compression. I haven't ever checked this box, but I know
  272. >it is there.
  273.  
  274. Checking the box won't compress the resource.
  275.  
  276. Apple has not released the resource compression info to the
  277. public (though certain companies have reverse-engineered it)
  278. This was because of the time constraint; resource compression
  279. was sort of a hack to get a System 7 on a HD floppy.
  280.  
  281. re cleaning it up, modularizing
  282. it (as always :-) and will release info for developers "sometime."
  283.  
  284. In the meantime, you can always head-patch GetResource to do
  285. the thing for you. Head patch, you say? Well, a patch that
  286. looks something like:
  287.  
  288.     SetResLoad ( 0 ) ;
  289.  
  290.     h = GetIntendedResource ( ) ;
  291.     if ( ! * h ) {
  292.  
  293.         LoadResource ( h ) ;
  294.         if ( * h ) {
  295.  
  296.             UncompressMyFormat ( h ) ;
  297.         }
  298.     }
  299.     SetResLoad ( 1 ) ;
  300.     JMP GetResource    <- This will find the already loaded resource!
  301.  
  302. I think Kent Borg was the guy who came up with this genial
  303. solution; hope he doesn't mind sharing it (at least he
  304. gets the credit :-)
  305.  
  306. You probably have to patch GetIndResource, GetNamedResource,
  307. LoadResource etc as well.
  308.  
  309. Cheer,s
  310.  
  311.                         / h+
  312.  
  313.  
  314. - -- 
  315.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  316.  
  317.    NCC-1701
  318.  
  319. +++++++++++++++++++++++++++
  320.  
  321. From: kent@lloyd.Camex.COM (Kent Borg)
  322. Organization: Camex Inc., Boston MA
  323. Date: Sat, 16 Jan 1993 22:45:25 EST
  324.  
  325. tte) writes:
  326. |>In <1993Jan15.235728.343@physc1.byu.edu> seth@physc1.byu.edu writes:
  327. |>
  328. |>>> The resource manager can now decompress resources.  Does anybody know if
  329. |>>> there is anything (code examples, application, etc.) that will let us
  330. |>>> compress our resources or is Apple the only one able to take advantage
  331. |>Apple has not released the resource compression info to the
  332. |>public (though certain companies have reverse-engineered it)
  333. |>This was because of the time constraint; resource compression
  334. |>was sort of a hack to get a System 7 on a HD floppy.
  335. |>
  336. re cleaning it up, modularizing
  337. |>it (as always :-) and will release info for developers "sometime."
  338. |>
  339. |>In the meantime, you can always head-patch GetResource to do
  340. |>the thing for you. Head patch, you say? Well, a patch that
  341. |>looks something like:
  342.  
  343. |>    SetResLoad ( 0 ) ;
  344.  
  345. |>    h = GetIntendedResource ( ) ;
  346. |>    if ( ! * h ) {
  347.  
  348. |>        LoadResource ( h ) ;
  349. |>        if ( * h ) {
  350.  
  351. |>            UncompressMyFormat ( h ) ;
  352. |>        }
  353. |>    }
  354. |>    SetResLoad ( 1 ) ;
  355. |>    JMP GetResource    <- This will find the already loaded resource!
  356.  
  357. |>I think Kent Borg was the guy who came up with this genial
  358. |>solution; hope he doesn't mind sharing it (at least he
  359. |>gets the credit :-)
  360.  
  361. Yes, I posted related stuff once and credit is always nice, thanks.
  362. (But was it really MacDTS that suggested it?  I forget.  For good
  363. measure, give them credit too--it spreads the blame...)
  364.  
  365. |>You probably have to patch GetIndResource, GetNamedResource,
  366. |>LoadResource etc as well.
  367.  
  368. And that is a problem.  There are lots of ways of get resources,
  369. growing all the time, and trying to catch them all, for everybody,
  370. always, is tricky.
  371.  
  372. If you have a specific resource you want to have an INIT tamper with
  373. before letting the Real Application see it (like a 'PREC' 103 in
  374. printing--my case) shinanigans like mine might be for you.
  375.  
  376. If you just want to decompress resources, look at the January 1993
  377. MacTutor aka MacTech article.  Apple can't break their own scheme
  378. anytime soon without breaking all the 7.0 floppies they shipped.
  379. Sure, they might do a better (read: bigger, meaner) solution, but if
  380. this one works now and plans to keep working, why not use it?
  381.  
  382. [The 7.0 resource compression scheme in summary, via Justin Gray of
  383. Alysis in MacTech: Put a 'dcmp' code resource in your file (great new
  384. virus vector!) that knows how to decompress your resource, then mark
  385. your compressed resource as compressed and point to the correct
  386. 'dcmp'.  And when anyone wants it through any calls, you do some fast
  387. "single-buffer" decompression and they are there.]
  388.  
  389.  
  390. - -kb, listening to classical music
  391.  
  392. - --
  393. Kent Borg            kent@camex.com or kentborg@aol.com (when it is *working*)
  394.                                             H:(617) 776-6899  W:(617) 426-3577
  395. The Quote that usually appears here will not be seen so that we can bring you
  396. the following message:  Camex is collapsing, so any Hot Job offers...
  397.  
  398. +++++++++++++++++++++++++++
  399.  
  400. From: bwilliam@iat.holonet.net (Bill Williams)
  401. Organization: HoloNet National Internet Access BBS: 510-704-1058/modem
  402. Date: Mon, 18 Jan 1993 00:44:24 GMT
  403.  
  404. I know a developer who liscnses his resource compression technologies for
  405. mac applications and resources. Using them you can shrink the size of your
  406. application dramatically.
  407.  
  408. Also using good compression in your application can make it load faster,
  409. especially from floppies or on fast machines.
  410.  
  411. The developer I am speaking of has compression faster loading, and
  412. smaller, than all known resource compression technologies. (Using Norton
  413. utilities as the benchmark application.) Over 400,000 und users have run
  414. his code in varioius products, but as advertising is frowned upon on the
  415. Internet, you should contact me via E-mail for his company number, prices,
  416. specs, etc.
  417.  
  418. PS. His resource compression is not only the smallest out there, it also
  419. makes some applications smaller than when compressed with traditional,
  420. non-resource compression technologies such as Compact Pro 1.33, etc.!!!
  421.  
  422. He also has a near-100% resource compressed system 6.08, microfinders, better
  423. compression of System 7, compressed finders, micro-Finders, etc. All for
  424. people who need to distribute utility software.
  425.  
  426. Bill Williams
  427.  
  428.  
  429. ---------------------------
  430.  
  431. From: ctvien@cs.concordia.ca (VIEN cam thanh)
  432. Subject: Where do I get the highlight color?
  433. Date: 18 Jan 93 01:57:25 GMT
  434. Organization: Computer Science, Concordia University, Montreal, Quebec
  435.  
  436. How can I get the highlight color defined in the color control panel?
  437. or any information set in the contol panels for that matter. (i.e.
  438. the location of the Mac in the Map control panel)
  439.  
  440.  
  441. Thanks
  442.  
  443.  
  444. Cam
  445.  
  446. +++++++++++++++++++++++++++
  447.  
  448. From: ross@bnr.ca (Ross Brown)
  449. Organization: Bell-Northern Research Ltd.
  450. Date: Mon, 18 Jan 1993 16:21:21 GMT
  451.  
  452. In article <5650@daily-planet.concordia.ca> ctvien@cs.concordia.ca (VIEN cam
  453. thanh) writes:
  454. >How can I get the highlight color defined in the color control panel?
  455. >or any information set in the contol panels for that matter. (i.e.
  456. >the location of the Mac in the Map control panel)
  457.  
  458. There's no standard method for all control panel settings, but I'll give you a
  459. direct answer to your question about getting the highlight color:
  460.  
  461. rgbColor = (*((GVarHandle)someCGrafPtr->grafVars))->rgbHiliteColor;
  462.  
  463. ...but make sure it's really a color GrafPort before you do this.
  464.  
  465. ==============================================================================
  466. Ross Brown, Dept. 7C22  < Bell-Northern Research     >  Just the facts, ma'am.
  467. Advisor, Telemgmt Svcs  < P. O. Box 3511, Station C  >  We don't care whose
  468. ross@bnr.ca             < Ottawa, ON, Canada K1Y 4H7 >  opinions yours aren't.
  469. ==============================================================================
  470.  
  471.  
  472. +++++++++++++++++++++++++++
  473.  
  474. From: christopher m. knox <chris@benton.prepress.com>
  475. Organization: Pre-Press Technologies, Inc.
  476. Date: Mon, 18 Jan 1993 17:20:34 GMT
  477.  
  478. Subject: Where do I get the highlight color?
  479. From: VIEN cam thanh, ctvien@cs.concordia.ca
  480. In article <5650@daily-planet.concordia.ca> VIEN cam thanh,
  481. ctvien@cs.concordia.ca writes:
  482. >How can I get the highlight color defined in the color control panel?
  483.  
  484. Hi,
  485. the highlight color is in a global variable: RGBColor HiliteRGB;
  486. Chris
  487. chris knox, primary programmer, SpectreTouch
  488.                                                     
  489. "Omne animal triste est post (or without) coitum"  Umberto Eco
  490.  
  491. +++++++++++++++++++++++++++
  492.  
  493. From: peirce@outpost.SF-Bay.org (Michael Peirce)
  494. Date: 18 Jan 93 17:58:17 GMT
  495. Organization: Peirce Software
  496.  
  497.  
  498. In article <5650@daily-planet.concordia.ca> (comp.sys.mac.programmer), ctvien@cs.concordia.ca (VIEN cam thanh) writes:
  499. > How can I get the highlight color defined in the color control panel?
  500. > or any information set in the contol panels for that matter. (i.e.
  501. > the location of the Mac in the Map control panel)
  502.  
  503. It lives at low mmeory $0DA0.  Here's an old piece of Pascal code
  504. I have that uses it:
  505.  
  506.  
  507.         BlockMove(Ptr($0DA0),@hiLiteColor,SIZEOF(RGBColor));
  508.         RGBForeColor(hiLiteColor);
  509.  
  510. hiLiteColor is declared as an RGBColor.
  511.  
  512. - --  Michael Peirce      --   peirce@outpost.SF-Bay.org
  513. - --  Peirce Software     --   Suite 301, 719 Hibiscus Place
  514. - --                      --   San Jose, California USA 95117
  515. - --  Makers of:          --   voice: (408) 244-6554 fax: (408) 244-6882
  516. - --             Smoothie --   AppleLink: peirce & America Online: AFC Peirce
  517.  
  518. ---------------------------
  519.  
  520. From: hd12@ellis.uchicago.edu
  521. Subject: List Manager help wanted
  522. Date: 4 Jan 93 06:19:05 GMT
  523. Organization: University of Chicago
  524.  
  525. I like to creat a list containing file names, size, date etc. Each entry
  526. should be in a single cell. After I put file name in the cell using
  527. LSetCell, I have to add size, date etc. in the same cell. Although I can
  528. use LAddToCell to do that but that will make the size field not aligned
  529. vertically. Anyone know an elegent way to handle this? Thank you very much.
  530.  
  531. BTW. I am using Think C 5.0.3, have lots of trouble with C and Pascal strings.
  532. Suppose I have:    Str255 mystring;
  533. Use: mystring="\p Something "; doesn't work. How could I assign a string to the
  534. variable mystring?
  535.  
  536. +++++++++++++++++++++++++++
  537.  
  538. From: Sproul@sproul.sproul.com (Mark Sproul)
  539. Date: 5 Jan 93 16:48:10 GMT
  540. Organization: Sproul Consulting
  541.  
  542.  
  543. In article <1993Jan4.061905.14455@midway.uchicago.edu> (comp.sys.mac.programmer), hd12@ellis.uchicago.edu writes:
  544. > I like to creat a list containing file names, size, date etc. Each entry
  545. > should be in a single cell. After I put file name in the cell using
  546. > LSetCell, I have to add size, date etc. in the same cell. Although I can
  547. > use LAddToCell to do that but that will make the size field not aligned
  548. > vertically. Anyone know an elegent way to handle this? Thank you very much.
  549. > BTW. I am using Think C 5.0.3, have lots of trouble with C and Pascal strings.
  550. > Suppose I have:    Str255 mystring;
  551. > Use: mystring="\p Something "; doesn't work. How could I assign a string to the
  552. > variable mystring?
  553.  
  554. To do what you want, first BEFORE creating the list, set the font
  555. for that list to Monoco.  This will set it to a mono-space font. 
  556. Any other monospace font will work as well.
  557.  
  558. next, with the file name do the following
  559.  
  560.     Str255    fName;    //* i assume you have a Pascal file name
  561.     char    lineBuf[128];
  562.  
  563.  
  564.  
  565.     PtoCstr(fName);
  566.     sprintf(lineBuf, "%-32s", fName);    //* this will put the file
  567. name left justfied in the string, padded with spaces, change the number
  568. as you need.
  569.  
  570.     dataLen    = strlen(lineBuf);
  571.     LSetCell(lineBuf,dataLen, ....etc
  572.  
  573. When you do your LAddToCell(), do it in similar manner.
  574.  
  575. One hint, I just discovered this morning that if the text is longer
  576. than the entire width of the window, it will condense the type to
  577. make it fit.
  578.  
  579. On your other question, as far as I know, Think C does not support,
  580.      mystring="\p Something ";
  581.  
  582. use
  583.     strcpy(mystring, " Something ");
  584.     CtoPstr(mystring);
  585.  
  586. or
  587.     sprintf(mystring, "\p Something ");
  588.  
  589. be sure to 
  590.     #include <string.h>
  591.     #include <stdio.h>
  592. and Link ANSI
  593.  
  594. - -----------------------------------------------------
  595. Mark Sproul - KB2ICI - New Jersey
  596. sproul@sproul.com
  597.  
  598. +++++++++++++++++++++++++++
  599.  
  600. From: hardin@dino.mcc.com (John Hardin)
  601. Organization: MCC ISD, Austin, Texas
  602. Date: Thu, 7 Jan 1993 05:16:14 GMT
  603.  
  604. Mark Sproul (Sproul@sproul.sproul.com) writes:
  605. >
  606. >  On your other question, as far as I know, Think C does not support,
  607. >       mystring="\p Something ";
  608. >
  609.  
  610. ThinkC DOES, in fact, support Pascal string literals.  P. 206 of the
  611. ThinkC 5 manual states "To write a Pascal string constant, start the
  612. string with "\P" or "\p"."
  613.  
  614. - -jwh
  615. - --
  616. John W. Hardin            phone:  (512)338-3535
  617. MCC                email:  hardin@mcc.com
  618. 3500 W. Balcones Center Dr  fax:    (512)338-3897
  619. Austin, TX  78759-6509        uucp:   ...!cs.utexas.edu!milano!hardin
  620.  
  621.  
  622. +++++++++++++++++++++++++++
  623.  
  624. From: bowman@reed.edu (BoBolicious)
  625. Organization: Reed College, Portland, OR
  626. Date: Thu, 7 Jan 1993 07:23:35 GMT
  627.  
  628. In article <HARDIN.93Jan6231614@dino.mcc.com> hardin@dino.mcc.com (John Hardin) writes:
  629. >Mark Sproul (Sproul@sproul.sproul.com) writes:
  630.  
  631. >>  On your other question, as far as I know, Think C does not support,
  632. >>       mystring="\p Something ";
  633.  
  634. >ThinkC DOES, in fact, support Pascal string literals.  P. 206 of the
  635. >ThinkC 5 manual states "To write a Pascal string constant, start the
  636. >string with "\P" or "\p"."
  637.  
  638. I missed the beginning of this thread, where mystring was apparently defined,
  639. but perhaps the key is that:
  640.  
  641. mystring = "\p somthing";
  642.  
  643. works if mystring is declared as an unsigned char *.
  644. It *doesn't* work if mystring is a Str255 or any other array construct where
  645. the actual storage is allocated on the stack.
  646.  
  647. cheers,
  648. bobo              In seeking the unattainable,
  649. bowman@reed.edu            simplicity only gets in the way.
  650. "On Monday, numbers floated everywhere, and the world was full of 
  651. approximations."  -- Spencer Heinz, _The Oregonian_, 1/5/93
  652.  
  653. +++++++++++++++++++++++++++
  654.  
  655. From: peter@cujo.curtin.edu.au (Peter N Lewis)
  656. Organization: Curtin University of Technology
  657. Date: Thu, 7 Jan 1993 13:37:40 GMT
  658.  
  659. Sproul@sproul.sproul.com (Mark Sproul) writes:
  660.  
  661.  
  662. >In article <1993Jan4.061905.14455@midway.uchicago.edu> (comp.sys.mac.programmer), hd12@ellis.uchicago.edu writes:
  663. >> I like to creat a list containing file names, size, date etc. Each entry
  664. >> should be in a single cell. After I put file name in the cell using
  665. >> LSetCell, I have to add size, date etc. in the same cell. Although I can
  666. >> use LAddToCell to do that but that will make the size field not aligned
  667. >> vertically. Anyone know an elegent way to handle this? Thank you very much.
  668.  
  669. >To do what you want, first BEFORE creating the list, set the font
  670. >for that list to Monoco.  This will set it to a mono-space font. 
  671. >Any other monospace font will work as well.
  672.  
  673. That will work, but you can write your own LDEF to display any
  674. information in any format you like.  An LDEF is probably the simplest
  675. proc code you can write.  You can get some pascal sample LDEF code
  676. with my Talk source code on
  677. sumex-aim.stanford.edu:/info-mac/source/pascal.  There is probably some
  678. sample code on ftp.apple.com:/dts/mac/sc somewhere.
  679.  
  680. The normal technique is to store a record/struct of the information you
  681. want and then write an LDEF proc to display it.
  682.  
  683. Good luck,
  684.    Peter.
  685. - -- 
  686. _______________________________________________________________________
  687. Peter N Lewis <peter@ncrpda.curtin.edu.au>           Ph: +61 9 368 2055
  688.  
  689. +++++++++++++++++++++++++++
  690.  
  691. From: larrym@mtxinu.COM (Larry Meyer)
  692. Date: 8 Jan 93 23:38:33 GMT
  693. Organization: mt Xinu, Berkeley, CA
  694.  
  695. In article <D2150096.mur2al@sproul.sproul.com> Sproul@sproul.sproul.com (Mark Sproul) writes:
  696. >
  697. >In article <1993Jan4.061905.14455@midway.uchicago.edu> (comp.sys.mac.programmer), hd12@ellis.uchicago.edu writes:
  698. >One hint, I just discovered this morning that if the text is longer
  699. >than the entire width of the window, [ListMgr] will condense the type to
  700. >make it fit.
  701. >
  702.  
  703. Wow, and I though I was just doing something stupid. I encountered
  704. this condensing "feature" recently, and I haven't been able to the 
  705. goddamn thing off. (No using a monospace font does not work).
  706. As far as I can tell, this condensing only occurs when
  707. you use Lists in a Modal Dialog (leading me to suspect that this
  708. is some hack introduced to aid in displaying long file names
  709. in the StdFileDlog, or something like that).
  710.  
  711. The reason I want it off is that I'm displaying columnar data in a
  712. List, and when ListMgr condenses it, it throws off alignment with
  713. column headers (Yeah, I know I can put the data into individual
  714. cells, but its not worth the effort in this situation).
  715.  
  716. Does anyone out there know how to turn off this "feature"?
  717. - -- 
  718. /----------------------------------------------------
  719. Larry Meyer Mac/Unix Programmer @ Xinet, Berkeley CA
  720. larrym@xinet.com (ask me about max<->unix stuff)
  721. - -----------------------------------------------------/
  722.  
  723. +++++++++++++++++++++++++++
  724.  
  725. From: chuck@gte.com (Chuck Hoffman)
  726. Date: 14 Jan 93 14:57:25 GMT
  727. Organization: GTE Laboratories
  728.  
  729. In article <1993Jan8.233833.3887@mtxinu.COM>, larrym@mtxinu.COM (Larry
  730. Meyer) wrote:
  731. > In article <D2150096.mur2al@sproul.sproul.com> Sproul@sproul.sproul.com (Mark Sproul) writes:
  732. > >
  733. > >In article <1993Jan4.061905.14455@midway.uchicago.edu> (comp.sys.mac.programmer), hd12@ellis.uchicago.edu writes:
  734. > >One hint, I just discovered this morning that if the text is longer
  735. > >than the entire width of the window, [ListMgr] will condense the type to
  736. > >make it fit.
  737. > >
  738. > Wow, and I though I was just doing something stupid. I encountered
  739. > this condensing "feature" recently, and I haven't been able to the 
  740. > goddamn thing off. (No using a monospace font does not work).
  741. > As far as I can tell, this condensing only occurs when
  742. > you use Lists in a Modal Dialog (leading me to suspect that this
  743. > is some hack introduced to aid in displaying long file names
  744. > in the StdFileDlog, or something like that).
  745.  
  746. List Manager does this to lists in regular windows, too.  If condensing the
  747. text is not enough to make it fit, LM will also truncate the text and put
  748. an elipsis "..." at the end of the part that gets displayed.  What I would
  749. like is to turn off the condensing part, and leave on the truncation /
  750. elipsis part.  Does anyone know how?
  751.  
  752. Chuck Hoffman
  753. chuck@gte.com
  754. GTE Laboratories, Waltham, Massachusetts, USA
  755. (617) 466-2131
  756. =====================================
  757. I'm not sure why we're here, but I am sure that while we're here we're
  758. supposed to help each other.
  759. =====================================
  760.  
  761. +++++++++++++++++++++++++++
  762.  
  763. From: kurisuto@bach.udel.edu (Sean J. Crist)
  764. Organization: University of Delaware
  765. Date: Thu, 14 Jan 1993 23:33:45 GMT
  766.  
  767. In article <chuck-140193095421@choffman.gte.com> chuck@gte.com (Chuck Hoffman) writes:
  768. >In article <1993Jan8.233833.3887@mtxinu.COM>, larrym@mtxinu.COM (Larry
  769. >Meyer) wrote: 
  770. >> In article <D2150096.mur2al@sproul.sproul.com> Sproul@sproul.sproul.com
  771.  (Mark Sproul) writes:
  772. >> >In article <1993Jan4.061905.14455@midway.uchicago.edu> (comp.sys.mac.programmer), hd12@ellis.uchicago.edu writes:
  773.  
  774. >> >One hint, I just discovered this morning that if the text is longer
  775. >> >than the entire width of the window, [ListMgr] will condense the type to
  776. >> >make it fit.
  777.  
  778. >> Wow, and I though I was just doing something stupid. I encountered
  779. >> this condensing "feature" recently, and I haven't been able to the 
  780. >> goddamn thing off. (No using a monospace font does not work).
  781. >> As far as I can tell, this condensing only occurs when
  782. >> you use Lists in a Modal Dialog (leading me to suspect that this
  783. >> is some hack introduced to aid in displaying long file names
  784. >> in the StdFileDlog, or something like that).
  785.  
  786. >List Manager does this to lists in regular windows, too.  If condensing the
  787. >text is not enough to make it fit, LM will also truncate the text and put
  788. >an elipsis "..." at the end of the part that gets displayed.  What I would
  789. >like is to turn off the condensing part, and leave on the truncation /
  790. >elipsis part.  Does anyone know how?
  791.  
  792. I wasn't aware of this feature, but it would seem that this behavior must
  793. be a part of the standard LDEF, since the List Manager proper has no
  794. knowledge of the meaning of the data in the cells or the way that those
  795. data are drawn by the LDEF.  (How would the List Manager 'condense' cells
  796. where the data are icons rather than text, for example?)  If this
  797. assumption is correct, then my recommendation would be just to write your
  798. own LDEF to display text as you like it.  This ought to be pretty simple
  799. and straightforward to write.
  800.  
  801. I wonder if this text-condensing LDEF is some new version written for
  802. System 7.  I haven't observed this behavior in earlier systems.
  803.  
  804.   \/ __ __    _\_     Kurisuto (Sean Crist)       
  805.  ---  |  |    \ /     Department of Linguistics    
  806.   _| ,| ,|   -----    University of Delaware      
  807.   _| ,| ,|    [_]     kurisuto@chopin.udel.edu     
  808.    |  |  |    [_]     Discl: I speak for myself.   
  809.  
  810.  
  811.  
  812. +++++++++++++++++++++++++++
  813.  
  814. From: peter@cujo.curtin.edu.au (Peter N Lewis)
  815. Organization: NCRPDA, Curtin University
  816. Date: Fri, 15 Jan 1993 06:32:54 GMT
  817.  
  818. In article <chuck-140193095421@choffman.gte.com>, chuck@gte.com (Chuck
  819. Hoffman) wrote:
  820. > In article <1993Jan8.233833.3887@mtxinu.COM>, larrym@mtxinu.COM (Larry
  821. > Meyer) wrote:
  822.  
  823. > > Wow, and I though I was just doing something stupid. I encountered
  824. > > this condensing "feature" recently, and I haven't been able to the 
  825. > > goddamn thing off. (No using a monospace font does not work).
  826. > > As far as I can tell, this condensing only occurs when
  827. > > you use Lists in a Modal Dialog (leading me to suspect that this
  828. > > is some hack introduced to aid in displaying long file names
  829. > > in the StdFileDlog, or something like that).
  830. > List Manager does this to lists in regular windows, too.  If condensing the
  831. > text is not enough to make it fit, LM will also truncate the text and put
  832. > an elipsis "..." at the end of the part that gets displayed.  What I would
  833. > like is to turn off the condensing part, and leave on the truncation /
  834. > elipsis part.  Does anyone know how?
  835.  
  836. You could always do it the good old fashioned way - add the elipse on
  837. yourself if necessary and use StringWidth to figure out making it fit in
  838. the list.  Here's some code I used a while back, of course, its probably
  839. not script manager compatible :-)
  840.  
  841.     procedure DotDotDot (var s: str255; var width: integer);
  842.         var
  843.             maxwidth, len: integer;
  844.     begin
  845.         maxwidth := width;
  846.         width := StringWidth(s);
  847.         if width > maxwidth then begin
  848. ');
  849. {$PUSH}
  850. {$R-}
  851.             len := ord(s[0]);
  852.             while (len > 0) and (width > maxwidth) do begin
  853.                 width := width - CharWidth(s[len]);
  854.                 len := len - 1;
  855.             end;
  856.             len := len + 1;
  857.             s[0] := chr(len);
  858. ';
  859. {$POP}
  860.         end;
  861.     end;
  862.  
  863. I'm not sure why you want to disable the feature - true it looks a bit
  864. strange, but it's what you'd do if you weren't on a computer, seems pretty
  865. sensible to me.
  866.  
  867. Have fun,
  868.    Peter.
  869.  
  870. _______________________________________________________________________
  871. Peter N Lewis <peter@cujo.curtin.edu.au>             Ph: +61 9 368 2055
  872.  
  873. +++++++++++++++++++++++++++
  874.  
  875. From: chuck@gte.com (Chuck Hoffman)
  876. Date: 15 Jan 93 15:47:49 GMT
  877. Organization: GTE Laboratories
  878.  
  879. In article <C0vAs9.JAp@news.udel.edu>, kurisuto@bach.udel.edu (Sean J.
  880. Crist) wrote:
  881. > I wonder if this text-condensing LDEF is some new version written for
  882. > System 7.  I haven't observed this behavior in earlier systems.
  883.  
  884. It behaves the same under System 6.0.7 on a IIsi and 7.0.1 on a IIcx.
  885.  
  886. Chuck Hoffman
  887. chuck@gte.com
  888. GTE Laboratories, Waltham, Massachusetts, USA
  889. (617) 466-2131
  890. =====================================
  891. I'm not sure why we're here, but I am sure that while we're here we're
  892. supposed to help each other.
  893. =====================================
  894.  
  895. +++++++++++++++++++++++++++
  896.  
  897. From: lynch@ils.nwu.edu (Richard Lynch)
  898. Organization: ILS
  899. Date: Fri, 15 Jan 1993 23:01:14 GMT
  900.  
  901. In article <chuck-140193095421@choffman.gte.com>, chuck@gte.com (Chuck
  902. Hoffman) wrote:
  903. > In article <1993Jan8.233833.3887@mtxinu.COM>, larrym@mtxinu.COM (Larry
  904. > Meyer) wrote:
  905. > > 
  906. > > In article <D2150096.mur2al@sproul.sproul.com> Sproul@sproul.sproul.com (Mark Sproul) writes:
  907. > > >
  908. > > >In article <1993Jan4.061905.14455@midway.uchicago.edu> (comp.sys.mac.programmer), hd12@ellis.uchicago.edu writes:
  909. > > >One hint, I just discovered this morning that if the text is longer
  910. > > >than the entire width of the window, [ListMgr] will condense the type to
  911. > > >make it fit.
  912. > > >
  913. > > 
  914. > > Wow, and I though I was just doing something stupid. I encountered
  915. > > this condensing "feature" recently, and I haven't been able to the 
  916. > > goddamn thing off. (No using a monospace font does not work).
  917. > > As far as I can tell, this condensing only occurs when
  918. > > you use Lists in a Modal Dialog (leading me to suspect that this
  919. > > is some hack introduced to aid in displaying long file names
  920. > > in the StdFileDlog, or something like that).
  921. > List Manager does this to lists in regular windows, too.  If condensing the
  922. > text is not enough to make it fit, LM will also truncate the text and put
  923. > an elipsis "..." at the end of the part that gets displayed.  What I would
  924. > like is to turn off the condensing part, and leave on the truncation /
  925. > elipsis part.  Does anyone know how?
  926.  
  927. I think, the guy who did SoundMaster must know how, since he did it in his
  928. control panel...
  929.  
  930. +++++++++++++++++++++++++++
  931.  
  932. From: winer@husc10.harvard.edu (Adam Winer)
  933. Date: 16 Jan 93 09:24:55 GMT
  934.  
  935. Re: getting List Manager to not condense text.
  936.  
  937. To do this, write your own LDEF: if there's interest, I'll post an LDEF
  938. which behaves the same as the standard LDEF, but with comments indicating
  939. which lines to comment out to remove either or both the condensing and
  940. ellipsis adding.  I've found that many of the problems of using the List
  941. Manager can be solved with a very simple LDEF, and writing a simple LDEF
  942. is easy once you have code for one, since you may only need to modify
  943. a couple of lines of code.
  944.  
  945. Adam
  946. - -- 
  947. Adam Winer              | The number you have reached is imaginary.
  948. WINER@HUSC.HARVARD.EDU  | Please rotate your phone 90 degrees and
  949.                         | try again.
  950.  
  951. +++++++++++++++++++++++++++
  952.  
  953. From: jsuker@orion.oac.uci.edu (Johnathon Suker)
  954. Date: 19 Jan 93 19:45:36 GMT
  955.  
  956. winer@husc10.harvard.edu (Adam Winer) writes:
  957.  
  958. >Re: getting List Manager to not condense text.
  959.  
  960. >To do this, write your own LDEF: if there's interest, I'll post an LDEF
  961. >which behaves the same as the standard LDEF, but with comments indicating
  962. >which lines to comment out to remove either or both the condensing and
  963. >ellipsis adding.  I've found that many of the problems of using the List
  964. >Manager can be solved with a very simple LDEF, and writing a simple LDEF
  965. >is easy once you have code for one, since you may only need to modify
  966. >a couple of lines of code.
  967.  
  968. Adam, 
  969.  
  970.     I would like code, if you wouldn't mind.
  971.  
  972.  
  973.                 Thanks in advance,
  974.  
  975.                     Johnathon
  976. - --
  977. Johnathon Suker                   | If I were human I believe the proper
  978. University of California, Irvine  | response would be, 'Go To Hell'. If I 
  979. Univeristy Library                | were human.
  980. jlsuker@UCI.EDU                   |             Spock - ST:TUC
  981.  
  982. ---------------------------
  983.  
  984. From: mtc@mundil.cs.mu.OZ.AU (Michael Trevor CUTTER)
  985. Subject: File system problem - RstLock not updating...
  986. Organization: Computer Science, University of Melbourne, Australia
  987. Date: Tue, 19 Jan 1993 00:05:50 GMT
  988.  
  989. Gudday,
  990.  
  991. I have an application that can't be run when it is locked (don't worry, it'll
  992. never run off CD-ROM or locked file server).
  993.  
  994. So, rather than worry about dweebs not being able to figure out how to unlock it
  995. I automatically unlock it using HRstLock on the application.
  996.  
  997. It works fine - except that the application thinks that it is locked until it
  998. quits and runs again.
  999.  
  1000. I have tried running FlushVol afterwards, but to no avail.
  1001.  
  1002. Any suggestions? I need to get the system to realise that the file has been 
  1003. unlocked. 
  1004.  
  1005. Please email or post.
  1006.  
  1007. Oh yeah, is there a way of telling whether it is locked or not without changing
  1008. that state? Easy way?
  1009.  
  1010. - -- 
  1011. Michael Cutter                        email: mtc@mundil.cs.mu.oz.au
  1012. Ictinus Network Development Team             mtc@arbld.unimelb.edu.au
  1013. BCAT Development Team                 snail: c/- 3 Barton Street
  1014. Department of Architecture & Building        Hawthorn, VIC, 3122 
  1015. University of Melbourne, Australia           AUSTRALIA
  1016.  
  1017. +++++++++++++++++++++++++++
  1018.  
  1019. From: absurd@apple.apple.com (Tim Dierks, software saboteur)
  1020. Date: 19 Jan 93 10:09:27 GMT
  1021. Organization: MacDTS Marauders
  1022.  
  1023. In article <9301911.17047@mulga.cs.mu.OZ.AU>, mtc@mundil.cs.mu.OZ.AU
  1024. (Michael Trevor CUTTER) wrote:
  1025. > Gudday,
  1026. > I have an application that can't be run when it is locked (don't worry, it'll
  1027. > never run off CD-ROM or locked file server).
  1028. > So, rather than worry about dweebs not being able to figure out how to unlock it
  1029. > I automatically unlock it using HRstLock on the application.
  1030. > It works fine - except that the application thinks that it is locked until it
  1031. > quits and runs again.
  1032. > I have tried running FlushVol afterwards, but to no avail.
  1033. > Any suggestions? I need to get the system to realise that the file has been 
  1034. > unlocked. 
  1035.  
  1036. The problem is that when the file is locked, the Process Manager can only
  1037. open a read-only access path when opening your application to run it.
  1038. Regardless of any changes to the file's state, that access path remains
  1039. read-only.  Here's my recommendation: if the file's locked and you
  1040. unlocked it, put up a dialog saying "MacWidget Pro can only run when
  1041. it is unlocked.  The file has been unlocked, but needs to be relaunched.
  1042. Please run MacWidget Pro again."  Because this should happen so rarely,
  1043. this shouldn't be a huge user problem.  This also gives you a good place
  1044. to put up a dialog saying "MacWidget Pro needs to be unlocked to run.
  1045. Please unlock MacWidget Pro and run it again." if you couldn't unlock
  1046. the file.  (Because it's on a CD-ROM or file server or locked floppy or
  1047. whatever.)
  1048.  
  1049. If you really really can't do this, and you really really need to
  1050. unlock your file, and you don't care if you've got to fix your app
  1051. with every new system release from now till doomsday (yes, I'm
  1052. trying to scare you), and you promise not to tell anyone I told you
  1053. this, and you didn't hear it here, and you won't bother me when it
  1054. breaks in a really spectacular way and erases all the hard drives in
  1055. a 10-mile radius, then you might be able to do what you want to do:
  1056. you could try looking through the FCB table to find the FCB associated
  1057. with your app and bashing the "write-OK" flag in the FCB (see the
  1058. bottom of Inside Mac IV, page 180).  You might also need to mark
  1059. the resource map as read-write.  And may God have mercy on your soul.
  1060.  
  1061. > Oh yeah, is there a way of telling whether it is locked or not without
  1062. > changing that state? Easy way?
  1063.  
  1064. Since the question isn't really "is the file locked" but "can I write to
  1065. the file", you should call GetFCBInfo to get info on your access path
  1066. to the file (pass the CurResFile() refNum as the refNum you're
  1067. interested in).  You check the same bit I told you not to change up
  1068. above.
  1069.  
  1070. Tim Dierks
  1071. MacDTS, but I speak for myself (hoo-boy, do I)
  1072.  
  1073. ---------------------------
  1074.  
  1075. From: jerry@uni-paderborn.de (Gerald Siek)
  1076. Subject: How to check for gray-scale screen?
  1077. Date: 19 Jan 1993 15:08:32 GMT
  1078. Organization: University of Paderborn, Germany
  1079.  
  1080. Hello wizards,
  1081.  
  1082. does anyone know how to check whether the user has selected color or 
  1083. gray-scale with the monitors control-panel?   I know how to distinguish
  1084. between color and B/W but how 'bout the gray-scale setting?
  1085.  
  1086. Any ideas?  Any help is greatly appreciated!   Thanks in advance!
  1087.  
  1088.     Jerry
  1089. - --
  1090.   Gerald Siek  -  jerry@uni-paderborn.de  -  University of Paderborn, Germany
  1091.  
  1092. +++++++++++++++++++++++++++
  1093.  
  1094. From: werner@dewey.soe.berkeley.edu (John Werner)
  1095. Date: 20 Jan 1993 00:47:56 GMT
  1096. Organization: School of Education, U.C. Berkeley
  1097.  
  1098. In article <1jh5hhINNcvg@news.uni-paderborn.de> jerry@uni-paderborn.de writes:
  1099. >does anyone know how to check whether the user has selected color or 
  1100. >gray-scale with the monitors control-panel?
  1101.  
  1102. For some reason, the 'gdDevType' device attribute tells you whether or
  1103. not the monitor is color.  So once you know what GDevice you're
  1104. dealing with, it's easy.  I have some code in my application that
  1105. looks like this:
  1106.  
  1107.  // Use "color" drawing on 4-bit color or 8-bit grayscale, or better
  1108.  Boolean useColor = depth >= 8 ||
  1109.                     (depth >= 4 && TestDeviceAttribute(theDevice, gdDevType));
  1110.  
  1111. I hope this helps....
  1112. - -- 
  1113. John Werner                        werner@soe.berkeley.edu
  1114. UC Berkeley School of Education    (510) 596-5868 (new number)
  1115.  
  1116. ---------------------------
  1117.  
  1118. End of C.S.M.P. Digest
  1119. **********************
  1120.